import request from '@/utils/request';
import { baseUrl } from '@/config/env';


export const getList = (page, size, params) => {
  return request({
    url: baseUrl+'/rest/dictType/list',
    method: 'post',
    params: {
      ...params,
      page,
      size,
    }
  })
}
export const remove = (dictTypeId) => {
  return request({
    url: baseUrl+'/rest/dictType/delete',
    method: 'post',
    meta: {
      isSerialize: true,
    },
    data: {
      dictTypeId,
    }
  })
}

export const add = (row) => {
  return request({
    url: baseUrl+'/rest/dictType/addItem',
    method: 'post',
    meta: {
      isSerialize: true,
    },
    data: row
  })
}

export const update = (row) => {
  return request({
    url: baseUrl+'/rest/dictType/editItem',
    method: 'post',
    meta: {
      isSerialize: true,
    },
    data: row
  })
}

export const getDictType = (dictTypeId) => {
  return request({
    url: `${baseUrl}/rest/dictType/detail`,
    method: 'post',
    meta: {
      isSerialize: true,
    },
    data: {
      dictTypeId
    }
  })
}